<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="pojo.OrderDto"  %>
<%@ page import="pojo.UnrentDto"  %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>chercOut</title>
    <link rel="stylesheet" href="checkOut.css">
</head>
<body class="bodyType">
    <div class="title">
        <samp>续租与退房</samp>
    </div>
     <!-- 续租 -->
    <div style="width: 1000px;">
        <div class="total">
            <div class="checkOutTitle">
                续租
            </div>
            <hr style="color: #f1f1f1; width: 100%;">

            <!-- 检测应缴费 -->
            <form action="reletServlet" method="post">
                <div class="relet">
                    <div>
                    	<%
                    		OrderDto order = (OrderDto)session.getAttribute("relet");
                    		if(order == null){
                    		%>
                    			<label for="reletRoom">房号：</label>
		                        <input type="text" style="height: 20px;" name="reletRoom" id="reletRoom">
		                        <label for="preDay" style="padding-left: 39px;">续租天数：</label>
		                        <input type="text" style="height: 20px;" name="preDay" id="preDay">
		                       
		                        <!-- 应付款框 -->
		                        <label for="" style="padding-left: 39px;">应缴付：</label>
		                        <div class="perpay" id="perpay"></div>
		    
		                        <input type="submit" style=" height: 25;margin-left: 39px;" value="续租">
                    		
                    		<%
                    		}else{
                    		%>
                    			 <label for="reletRoom">房号：</label>
		                        <input type="text" style="height: 20px;" name="reletRoom" value=<%=order.roomNum %> id="reletRoom">
		                        <label for="preDay" style="padding-left: 39px;">续租天数：</label>
		                        <input type="text" style="height: 20px;" name="preDay" value=<%=order.preDay %> id="preDay">
		                       
		                        <!-- 应付款框 -->
		                        <label for="" style="padding-left: 39px;">应缴付：</label>
		                        <div class="perpay" id="perpay"><%=order.nowPaid %></div>
		                        <input type="submit" style=" height: 25;margin-left: 39px;" value="续租">
                    		<%
                    		}
                    	 %>
                    </div>
                </div>
            </form>
            
        </div>

        <!-- 结账 -->
        <div class="total">
            <div class="checkOutTitle">
                结账
            </div>
            <hr style="color: #f1f1f1; width: 100%;">
            <form action="unrentServlet" method="post">
            	
            	<%	
            		UnrentDto unrent = (UnrentDto)session.getAttribute("unrentDto");
            		if(unrent == null){
            		%>
            			<div class="relet">
		                    <div style="margin-top: 6px;">
		                        <label for="payment">房号：</label>
		                        <input type="text" style="height: 20px;" name="payment" id="payment">
		                        <input type="submit" value="结算">
		                    </div>
		                    <div style="margin-top: 6px;">
		                        <!-- 付款框 -->
		                        <label for="">退款：</label>
		                        <div class="perpay" id="pay"></div>
		                    </div>
		                </div>
            		<%
            		}else{
            		%>
            			<div class="relet">
		                    <div style="margin-top: 6px;">
		                        <label for="payment">房号：</label>
		                        <input type="text" style="height: 20px;" value=<%=unrent.roomNum %> name="payment" id="payment">
		                        <input type="submit" value="结算">
		                    </div>
		                    <div style="margin-top: 6px;">
		                        <!-- 付款框 -->
		                        <label for="">退款：</label>
		                        <div class="perpay" id="pay"><%=unrent.money %></div>
		                    </div>
		                </div>
            		<%
            		}
            	 %>
            </form>
        </div>
    </div>
</body>
</html>